package com.doubao.config.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;;
import org.springframework.context.annotation.Configuration;
import org.springframework.validation.annotation.Validated;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Min;
import javax.validation.constraints.Max;

@Data
@Validated
@Configuration
@ConfigurationProperties(prefix = "doubao.api")
public class DouBaoProperties {
    /**
     * 豆包模型端点ID
     */
    @NotBlank(message = "endpointId不能为空")
    private String endpointId = "ep-20241021192316-7c94n";  // 修改默认值

    /**
     * API密钥
     */
    @NotBlank(message = "apiKey不能为空")
    private String apiKey = "f65fcf30-0c54-45ab-9fdc-e873c81f2fdf";  // 添加默认值

    /**
     * API基础URL
     */
    @NotBlank(message = "baseUrl不能为空")
    private String baseUrl = "https://ark.cn-beijing.volces.com/api/v3";

      /**
     * 请求超时时间（秒）
     */
    @Min(value = 1, message = "timeout不能小于1秒")
    @Max(value = 300, message = "timeout不能大于300秒")
    private int timeout = 30;

    /**
     * 重试次数
     */
    @Min(value = 0, message = "retryTimes不能为负数")
    @Max(value = 5, message = "retryTimes不能大于5次")
    private int retryTimes = 2;

    /**
     * 最大Token数量
     */
    @Min(value = 100)
    @Max(value = 8000)
    private int maxTokens = 4000;

    /**
     * 历史记录保存时间（小时）
     */
    @Min(value = 1)
    @Max(value = 72)
    private int historyRetentionHours = 24;
}
